package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AppChatRecordMapper;
import com.ruoyi.system.domain.AppChatRecord;
import com.ruoyi.system.service.IAppChatRecordService;

/**
 * 聊天记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-04-04
 */
@Service
public class AppChatRecordServiceImpl implements IAppChatRecordService 
{
    @Autowired
    private AppChatRecordMapper appChatRecordMapper;

    /**
     * 查询聊天记录
     * 
     * @param id 聊天记录主键
     * @return 聊天记录
     */
    @Override
    public AppChatRecord selectAppChatRecordById(Long id)
    {
        return appChatRecordMapper.selectAppChatRecordById(id);
    }

    /**
     * 查询聊天记录列表
     * 
     * @param appChatRecord 聊天记录
     * @return 聊天记录
     */
    @Override
    public List<AppChatRecord> selectAppChatRecordList(AppChatRecord appChatRecord)
    {
        return appChatRecordMapper.selectAppChatRecordList(appChatRecord);
    }

    /**
     * 新增聊天记录
     * 
     * @param appChatRecord 聊天记录
     * @return 结果
     */
    @Override
    public int insertAppChatRecord(AppChatRecord appChatRecord)
    {
        appChatRecord.setCreateTime(DateUtils.getNowDate());
        return appChatRecordMapper.insertAppChatRecord(appChatRecord);
    }

    /**
     * 修改聊天记录
     * 
     * @param appChatRecord 聊天记录
     * @return 结果
     */
    @Override
    public int updateAppChatRecord(AppChatRecord appChatRecord)
    {
        return appChatRecordMapper.updateAppChatRecord(appChatRecord);
    }

    /**
     * 批量删除聊天记录
     * 
     * @param ids 需要删除的聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteAppChatRecordByIds(Long[] ids)
    {
        return appChatRecordMapper.deleteAppChatRecordByIds(ids);
    }

    /**
     * 删除聊天记录信息
     * 
     * @param id 聊天记录主键
     * @return 结果
     */
    @Override
    public int deleteAppChatRecordById(Long id)
    {
        return appChatRecordMapper.deleteAppChatRecordById(id);
    }
}
